package com.easylinkin.linkappapi.ruleengine.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.easylinkin.linkappapi.ruleengine.entity.RuleExecution;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
import java.util.Set;
import org.apache.ibatis.annotations.Param;

/**
 * <p>
 * 执行器 Mapper 接口
 * </p>
 *
 * @author TongJie
 * @since 2020-08-24
 */
public interface RuleExecutionMapper extends BaseMapper<RuleExecution> {

    IPage<RuleExecution> getRuleExecutions(@Param("page") Page page, @Param("ruleExecution") RuleExecution ruleExecution);

    List<RuleExecution> getRuleExecutions(@Param("ruleExecution") RuleExecution ruleExecution);

    RuleExecution getRuleExecution(@Param("id") String id);

    /**
     * 查找 执行器以及执行器关联的下行设备 ，查找条件：规则引擎id列表
     *
     * @param ruleEngineIds 规则引擎id列表
     */
    List<RuleExecution> getRuleExecutionWithLinkageConfigRefDownDeviceList(@Param("ruleEngineIds") Set<String> ruleEngineIds);

    List<RuleExecution> getRuleExecutionDetails(@Param("ruleExecution") RuleExecution ruleExecution);

    int batchInsert(@Param("list") List<RuleExecution> list);
}
